local skel = fk.CreateSkill {
  name = "emo__duotao",
  tags = {Skill.Compulsory},
}

skel:addEffect(fk.TargetConfirmed, {
  anim_type = "drawcard",
  can_trigger = function (self, event, target, player, data)
    return target == player and player:hasSkill(skel.name) and data.from ~= player and player:getMark("@emo__duotao") > 0
  end,
  on_use = function (self, event, target, player, data)
    local n = player:getMark("@emo__duotao")
    player.room:setPlayerMark(player, "@emo__duotao", 0)
    player:drawCards(n, skel.name)
  end,
})

skel:addEffect(fk.TurnEnd, {
  anim_type = "defensive",
  can_trigger = function (self, event, target, player, data)
    return player:hasSkill(skel.name)
  end,
  on_use = function (self, event, target, player, data)
    player.room:addPlayerMark(player, "@emo__duotao", 1)
  end,
})

skel:addLoseEffect(function (self, player, is_death)
  player.room:setPlayerMark(player, "@emo__duotao", 0)
end)

skel:addAcquireEffect(function (self, player, is_start)
  player.room:setPlayerMark(player, "@emo__duotao", 1)
end)

skel:addEffect("distance", {
  correct_func = function(self, from, to)
    if to:hasSkill(skel.name) then
      return to:getMark("@emo__duotao")
    end
  end,
})


Fk:loadTranslationTable{
  ["emo__duotao"] = "堕逃",
  [":emo__duotao"] = "锁定技，其他角色与你距离+1，每回合结束时此值+1。当你成为其他角色牌目标后，此值清零其你摸等量张牌。",
  ["@emo__duotao"] = "堕逃",
}


return skel
